Component({
  properties: {
    selected: {
      type: Number,
      value: 0
    },
    type:{
      type:String,
      value:""
    }
  },
  data: {
    color: "#C7C7E8",
    selectedColor: "#4848CA",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "/img/home.png",
      selectedIconPath: "/img/home1.png",
      text: "首页"
    }, {
      pagePath: "/pages/userCenter/userCenter",
      iconPath: "/img/user.png",
      selectedIconPath: "/img/user1.png",
      text: "我的"
    }]
  },
  attached() {},
  methods: {
    goInvoicePage() {
      let data={
        path:'/pages/invoicingApplication/invoicingApplication',
        type:2
      }
      this.triggerEvent("tabbarClick",data)
      // wx.navigateTo({
      //   url: '/pages/invoicingApplication/invoicingApplication',
      // })
    },
    newSigned: function () {
      let data={
        path:'/pages/newSigned/newSigned',
        type:3
      }
      this.triggerEvent("tabbarClick",data)
      // wx.navigateTo({
      //   url: '/pages/newSigned/newSigned',
      // })
    },
    switchTab(e) {
      const index = e.currentTarget.dataset.index;
      const url = e.currentTarget.dataset.path
      let data={
        path:url,
        type:index
      }
      this.triggerEvent('tabbarClick',data)
     
      
      // // let that = this
      // wx.reLaunch({
      //   url,
      //   // success() {
      //   //   that.setData({
      //   //     selected: data.index
      //   //   })
      //   // }
      // })
    }
  }
})